-
Notifications
You must be signed in to change notification settings - Fork 705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit ItemLink Name to 16 Characters #4318
base: main
Are you sure you want to change the base?
Limit ItemLink Name to 16 Characters #4318
Conversation
We never truncated item and location names tbh |
This will result in weird exceptions when the name overlaps, right? I wonder if the Exception could be a bit more verbose here Something like this (extremely loose and unoptimized code) if len(name) > 16:
name = name[:16]
if name in ...:
raise Exception("After being truncated, the name already exists. Item link names must differ in the first 16 characters")
... Then again I'm often quite a lot more prone to writing a million user friendly exceptions than other devs, so maybe this is not necessary |
An alias and player name can be shown when getting |
Could do that, I just borrowed the already used barebones style Line 295 in f26cda0
Line 296 in f26cda0
Line 297 in f26cda0
|
So this isn't technically true because of names like " |
What is this fixing or adding?
Aliases and player names are both limited to 16 characters, however, ItemLink names are not. This truncates them to sixteen characters as well.
Also changes the error message to be more specific about the conditions for identical item link names and adds quotation marks around the name itself.
How was this tested?
Not all that much, generating an itemlink with the name "Just A Really Long Name" and both generating and uploading a world on a local webhost using the same itemlink group. Checked that the name everywhere had been shortened and connected to the multiworld to get some checks.